It has been known to happen to some people. When we do dream the muscles more or less lock up. So we can't act out the dream we are having. We know that people can sleep walk. So if you can walk during sleep without knowing you are doing it, why not do what you are doing too? It is possible. Don't know of any magic cure. Just make sure there is nothing sharp around your bed.