Moved asio socket's throwing constructor inside try catch block.