Fix `std::bad_alloc` errors for remote builds

In Nix the protocol was slightly altered[1] to also contain more information about realisations. This however wasn't read from the pipe that was used to read from the store.

After the cmdBuildDerivation command which caused this issue, Hydra will issue a cmdQueryPathInfos that tries to read from the remote store as well. However, there's still left over to read from the previous command and thus Nix fails to properly allocate the expected string.

[1] See rev a2b69660a9b326b95d48bd222993c5225bbd5b5f

Fixes #898

Created by  Maximilian Bosch  on April 15, 2021
INDUH5BNWPHG4PMPQDA5XWJ2VW6FZQTMGZ4FOAX2X2STZEPJUSDAC
Change contents