The suspect who killed a man with a knife in a Hamburg supermarket was a known Islamist with psychological problems but his motives remain unclear, German officials say.