[daemon] Refactor metadata handler code
h_metadentry.cpp
needs to be refactored:
- Some handlers throw runtime errors, crashing the server
- Errors are caught and logged but ignored (e.g., when RPC input cannot get read)
- Responding and cleanup has very old style. Use
rpc_cleanup_respond()
instead to reduce redundancy and clarity.