closes #44914 by changing the path object to string if it is of io.BufferWriter
Changes the path object in to_parquet to string type if it is io.BufferWriter type. PyArrow does not remove the partial file on disk if the path is not string type.

- [x] closes #44914 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] Added code to convert path object from io.BufferWriter type to string type. 

I have added two tests: 
- Checks to see if PyArrow raises an error when dtype=fp16
- Checks to see if PyArrow removes partial files from disk in case of error  thanks @Anirudhsekar96  This makes mypy fail:

`pandas/io/parquet.py:184: error: "RawIOBase" has no attribute "name"  [attr-defined]` I have opened a new pull request for resolving mypy fail (https://github.com/pandas-dev/pandas/pull/45570)