patch by Pieter Grimmerink: properly initialize and check for LCD fd