Add msg_try_receive

msg_try_receive implementation by ludwig.

looks reasonable to me, please review!