Refactor: libcrmcommon: Rearrange internal_ipc_get_reply.
This is intended to make the code a little easier to follow so I can
make further modifications to it. Changes:
- Rewrite conditionals and move them higher up in the function to allow unindenting things.
- Rename "bad" to "reply".
- Define variables at the top of the function. Note that a later patch will add a use of hdr at the bottom of the function, while reply will be turned into a parameter.
- Add a separate variable for the timeout we're passing to qb_ipcc_recv.