Thank you for the query.
Such symptom appears due to long term arm compression what causes nerve ischemia
and temporal paralysis
. Most likely it is caused by your sleeping position. Also lower than heart level position of your arm can disturb blood circulation and give such symptoms.
Needles and pins are nothing unnatural and are very common with such ischemia.
The best way to prevent it is to change your sleeping position so the arms will be freely disposed so the blood flow wont be impeded.
Hope this will help.