Tesla posts loss, claims profits are in sight