The Pencil and Brush tools are useful, but sometimes frustrating. I always found the open paths it creates particularly annoying. A simple solution is to press the Option/Alt key when you are ready to close a path. Once pressed, it will join the first and last anchor points with a straight line. Holding down the Option/Alt key and drawing a little past the starting anchor will close the path automatically.