Fix to read data even if stdin is a stream

If, stdin is not a file, it is neither redirection file, if data is streaming,
It is erro such as:

```bash
$ convert input.png jpeg:- | ./jpeg-recompress - output.jpg
Only able to read 123824 bytes!
```

This PR will fix to read the input data in such cases.


It looks like this first `malloc` isn't necessary. From http://www.cplusplus.com/reference/cstdlib/realloc/

> In case that ptr is a null pointer, the function behaves like malloc, assigning a new block of size bytes and returning a pointer to its beginning.

Removing this line locally still works for me.