Mount /dev/shm as a tmpfs

Fixed #1122.