kojikamid: write buildrequires files as bytes
Fix a TypeError when downloading buildrequires files on Python 3.
base64.b64decode() returns bytes, so we must open the file for writing
in bytes mode, not text mode.
Add a unit test that verifies this behavior.